//
// Created by Semir on 2020/6/8.
//

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

const int FACE = 6;

vector<pair<int, double>> dicesSum(int n) {
    vector<pair<int, double>> res;
    if (n < 1) {
        return res;
    }
    vector<long long> arr(FACE * n + 1, 0);
    for (int i = 1; i <= FACE; i++) {
        arr[i] = 1;
    }
    for (int i = 2; i <= n; i++) {
        for (int j = FACE * n; j >= i; j--) {
            arr[j] = 0;
            for (int k = j - 1; k >= j - FACE && k > 0; k--) {
                arr[j] += arr[k];
            }
        }
        for (int j = i - 1; j > 0; j--) {
            arr[j] = 0;
        }
    }
    double total = pow(FACE, n);
    for (int i = n; i <= 6 * n; i++) {
        res.emplace_back(pair<int, double>(i, ( arr[i]) / total));
    }
    return res;
}

int main() {
    vector<pair<int, double>> res = dicesSum(4);
    for (const auto& p : res) {
        cout << p.first << " " << p.second << endl;
    }
    return 0;
}